<template>
  <div class="content">
    <el-table :data="tableData" border style="width: 100%" @row-click="getData" >
      <!-- 表格数据渲染 -->
      <el-table-column
        v-for="item in linklist"
        :key="item.id"
        :label="item.name"
        width="120"
      >
        <template slot-scope="scope">
          <router-link
            :to="{ path: item.url, query: { editInfo: scope.row } }"
            v-if="item.isRouter"
            >{{ scope.row[titleList[item.id]] }}
          </router-link>
          <template v-else>
            {{ scope.row[titleList[item.id]] }}
          </template>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "List",
  data() {
    return {
    };
  },
  components: {},
  methods: {
    getData(row) {
      this.$emit("JumpAddGoodsPage", row);
    },
  },
  props: {
    // 跳转路由
    linklist: Array,
    titleList:Array,
    tableData:Array
  },
};
</script>

<style>
</style>